package com.zr.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.zr.model.Leave;
import com.zr.service.HRServicedtp;
import com.zr.serviceImpl.HRServiceImpldtp;

import net.sf.json.JSONObject;

public class ApplyVacationControllerdtp extends HttpServlet {
	HRServicedtp hr=new HRServiceImpldtp();
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		doPost(req, resp);
	}
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		resp.setCharacterEncoding("utf-8");
		int id=Integer.parseInt(req.getParameter("id"));
		JSONObject json=new JSONObject();
		json=hr.findListById(id);
		PrintWriter pw=resp.getWriter();
		pw.write(json.toString());
		pw.flush();
		pw.close();
		
	}
}
